<template>
	<view style="text-align: center;">
		<view style="margin-top: 100px;">
			<image :src="iconFilePath" @click="updateImage()" mode="aspectFill"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				iconFilePath: "/static/logo.png"
			}
		},
		methods: {
			updateImage() {
				uni.chooseImage({
					count: 1,
					sourceType: ['album'],
					success: (res) => {
						console.log("updateImage -->" + res.tempFilePaths[0]);
						this.iconFilePath = res.tempFilePaths[0];

						this.previewImage([res.tempFilePaths[0]]);
					}
				});
			},
			previewImage(images) {
				uni.previewImage({
					urls: images
				})
			}
		}
	}
</script>